<template>
  <div>
    <h2>今天的天气{{ text }}</h2>
    <button @click="showClick">点击切换天气</button>
  </div>
</template>

<script>
export default {
  name: "demo",
  data() {
    return {
      isHot: true,
    };
  },
  computed: {
    text() {
      return this.isHot ? "炎热" : "寒冷";
    },
  },
  methods: {
    showClick() {
      return (this.isHot = !this.isHot);
    },
  },
};
</script>

<style scoped>
</style>